package com.woniu.outlet.mapper;

import com.woniu.outlet.po.User;
import com.woniu.outlet.po.UserExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface UserMapper {
    long countByExample(UserExample example);

    int deleteByExample(UserExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    List<User> selectByExample(UserExample example);

    User selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

    int updateByExample(@Param("record") User record, @Param("example") UserExample example);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    @Select("\n" +
            "select p.percode\n" +
            "from rbac_perms p,rbac_user_perm up,rbac_user u\n" +
            "where p.id=up.permid and up.userid=u.id and u.username=#{username}")
    List<String> getUserPercodeByUser(String username);
}